/**
 * 创建日期:2017/11/23 10:14
 * 创建作者:ewjx
 * 修改日期:2017/11/23 10:14
 * 备注信息:文章页面
 */
import {OtherNavHtml} from '../component/nav.component';
import {ArticleList} from '../component/posted-list.component';
import {WriteComponent} from '../component/write.component';

export class Article {
    constructor() {
        this.articleList = new ArticleList();
    }

    getElement() {
        $('#nav-menu').inner(OtherNavHtml());
        $('#content').inner(this.articleList.toElement());
        $('#footer').inner(WriteComponent('回复'));
    }

    toEvent() {
        const cls = `.${window.location.hash.split('/')[1]}-nav`;
        $(cls).hide();
        $('.other-link').event('mouseover', function() {
            $(cls).show();
        });
        $('.other-link').event('mouseout', () => {
            $(cls).hide();
        });
        $('#menu').event('mouseover', () => {
            $(cls).show();
        });
        $('#menu').event('mouseout', () => {
            $(cls).hide();
        });
    }
}

